import Actions from './Actions';
import React from 'react';
import '../../style.less';
import { useInbizPrefixCls, useToolbar } from '../../hooks';

const Toolbar = (props:any) => {
  const { readOnly } = props
  const prefixCls = useInbizPrefixCls('subtable-toolbar');
  const toolbar = useToolbar(props, readOnly);

  return toolbar ? (
    <div className={prefixCls}>
      <Actions {...toolbar} />
    </div>
  ) : null;
};

export default React.memo(Toolbar);
